Technical Q&As
QD3D 17 - TQ3ViewObject and Bounding Box Calculating Routines (1-June-95)
Q What effect does the TQ3ViewObject parameter have in the bounding-box
calculating routines (Q3View_StartBounds and Q3View_EndBounds)? The old
geometric-object routine descriptions refer to world space, but if this is the
case, there is no need for a view parameter. However, if the view's camera is
used, the bounding box is returned in camera coordinates, rather than view
coordinates. Since both are useful, would it be possible to have both sets of
routines available? I can apply a rotation/translation matrix to the whole of
the items to be drawn to generate camera coordinates from a world coordinate
routine, but I need to find out if I need to do this or if this has already
been accomplished.
A The bounding box/bounding sphere calculations are returned in world space.
You can get the local space bounding box by simply making the world/local spaces identical, e.g., by not submitting any transforms.
Part of the reason the API was modified to use submit calls, rather than having separate pick, draw, and write calls, is that the transformations applied matter more than the camera.
Since these
modifications were made, the submit calls for everything (including
transformations, if they are not stored in the group) can be in one function
that is called from the Begin, End, write, pick, and draw calls. If you need
the bounding box for a single geometry in its own coordinate space, this is
also easy to do -- you can write a simple routine that performs bounds
calculations on a single object. For example:
StartBoundingBox();
Object_Submit();
EndBoundingBox();
Technical Q&As
Previous Question | Contents | Next Question